<?php include dirname(__FILE__).'/common/header.php'; ?>

<?php include dirname(__FILE__).'/common/menu.php'; ?>

var attr = {};
attr.ctrlName = '<?php echo $ctrlName; ?>';

/*
| -------------------------------------------------------------------
|  List Grid
| -------------------------------------------------------------------
*/
list.grid = new ZM.GridPanel({
    url: list.baseUrl + attr.ctrlName+'/getCustomerList',
    tbar:[{
        text:'导出过滤顾客',
        cls:'btn-show',
        hidden:!Ext.permission[attr.ctrlName + '/exportCustomerList'.toLowerCase()],
        handler:function() {
            var sortInfo = list.grid.store.getSortState();
            if(sortInfo) {
                list.grid.store.baseParams['sort'] = sortInfo['field'];
                list.grid.store.baseParams['dir'] = sortInfo['direction'];
            }
            location.href = list.baseUrl + attr.ctrlName + '/exportCustomerList?'+ Ext.urlEncode(list.grid.store.baseParams);
        }
    }],
    columns:[
        {header:'ID',dataIndex:'customer_id',filter:{}},
        {header:'姓名',dataIndex:'customer_name',filter:{}},
        {header:'手机号',dataIndex:'customer_phone',filter:{}},
        {header:'姓名',dataIndex:'customer_sex',filter:{xtype:'combofield',options:[['','全部'],['0','未知'],[1,'男'],[2,'女']]},renderer:function(val) {
            return ZM.id2name(val,[[0,'未知'],[1,'男'],[2,'女']]);
        }},
        {header:'省份',dataIndex:'customer_province',filter:{}},
        {header:'城市',dataIndex:'customer_city',filter:{}},
        {header:'经销商',dataIndex:'customer_shop',filter:{}},
        {header:'创建时间',dataIndex:'customer_time_create',width:140,filter:{xtype:'daterangefield'}}
    ]
});


<?php include dirname(__FILE__).'/common/layout.php'; ?>
list.grid.store.load();
<?php include dirname(__FILE__).'/common/footer.php'; ?>